package com.bstek.udm.sample.config;

import com.bstek.udm.server.filter.UdmJavaxFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author William.Jiang
 * @since 2025/3/18
 */
@Configuration
public class UdmConfig implements WebMvcConfigurer {

    @Bean
    public FilterRegistrationBean<UdmJavaxFilter> registerReportFilter() {
        FilterRegistrationBean<UdmJavaxFilter> registration = new FilterRegistrationBean<>(new UdmOriginFilter());
        registration.addUrlPatterns("/udmserver/*");
        registration.setName("udmserver");
        registration.setOrder(1);
        return registration;
    }
}